package zb.blog.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import zb.blog.base.bean.Result;
import zb.blog.service.IStatisticsService;

/**
 * @Author: BinZhang
 * @Date: 2018/5/1 15:24
 * @Description:统计相关
 */
@Controller
@RequestMapping("/statistics")
public class StatisticsController {
    @Autowired
    private IStatisticsService iStatisticsService;

    /**
     * @Author: BinZhang
     * @Date: 2018/6/5 1:38
     * @Description:获取总请求量
     */
    @RequestMapping("")
    @ResponseBody
    public Result getCountMsg() {
        return iStatisticsService.getCountMsg();
    }

    /**
     * @Author: BinZhang
     * @Date: 2018/6/5 1:40
     * @Description:获取每日请求量数据
     */
    @RequestMapping("/back/getReqOfDay")
    @ResponseBody
    public Result getReqOfDay() {
        return iStatisticsService.getReqOfDay();
    }

    /**
     * @Author: BinZhang
     * @Date: 2018/6/5 1:44
     * @Description:获取各个分块的请求量
     */
    @RequestMapping("/back/getReqPercent")
    @ResponseBody
    public Result getReqPercent() {
        return iStatisticsService.getReqPercent();
    }
}
